<body>
<h1>ZigBee Application Programming Interface</h1>
<h2>Overview</h2>
<p>
<h2>Library Layers</h2>
<p>
<h2>Device Discovery</h2>
The library implements three discovery methods through the {@link org.bubblecloud.zigbee.network.discovery.AssociationNetworkBrowser},
 {@link org.bubblecloud.zigbee.network.discovery.LinkQualityIndicatorNetworkBrowser}
 and {@link org.bubblecloud.zigbee.network.AnnounceListener}. When a node is discovered, {@link org.bubblecloud.zigbee.network.discovery.EndpointBuilder}
 is called. This queries the device for the {@link org.bubblecloud.zigbee.network.impl.ZigBeeNodeDescriptor}, and The {@link org.bubblecloud.zigbee.network.impl.ZigBeeNodePowerDescriptor}
 and then adds the {@link org.bubblecloud.zigbee.network.ZigBeeNode} and all the individual {@link org.bubblecloud.zigbee.network.ZigBeeEndpoint}s.
 If no endpoints are discovered, the node is removed.
 <p>
 Notifications to higher layers are made through the {@link org.bubblecloud.zigbee.network.NodeListener} when a node is added, and through
 {@link org.bubblecloud.zigbee.network.EndpointListener} when an endpoint is added. 
  
<p>
<h2>Battery Device Operation</h2>
<p>
Note that in the ZigBee Pro stack profile the MAC of the router is buffering
the indirect transmissions addressing sleeping end devices (aka
<i>rxOnWhenIdle</i>=false) for exactly 7.5s. After this interval an indirect
message is purged by the router.
<p>
So if you send a message, say from the coordinator, to a sleeping end device,
the device might not be able to extract the message from its router via a
poll, unless it polls its router with a period <= 7.5s which the HA profiles
specification does not allow and would waste too much energy on the device.
<p>
Since battery powered devices cannot normally poll their routers at these
rates due to energy constraints, so you cannot talk to a device at any time.
<p>
Instead, these device can be configured to report (some of) their attributes
to the coordinator with a long period, say once every 10 minutes. Usually,
the device's stack will poll it's router shortly after sending the report.
maybe to receive an application acknowledge from the coordinator.
<p>
This will be the time to try to talk to the device and you must do that
quickly. In the meantime, the messages to be delivered to a sleeping end
device must be buffered by the sender because the device's router cannot
buffer them for more than 7.5s.
<p>
On the reply timeout you should choose a value > 7.5s. Waiting much more is
not needed if the route to the device already exists.

<h2>Sensors</h2>
The following sensor interfaces are supported -:
<ul>
<li>{@link org.bubblecloud.zigbee.api.cluster.impl.api.measurement_sensing.ElectricalMeasurement}</li>
<li>{@link org.bubblecloud.zigbee.api.cluster.impl.api.measurement_sensing.IlluminanceMeasurement}</li>
<li>{@link org.bubblecloud.zigbee.api.cluster.impl.api.measurement_sensing.OccupancySensing}</li>
<li>{@link org.bubblecloud.zigbee.api.cluster.impl.api.measurement_sensing.RelativeHumidityMeasurement}</li>
<li>{@link org.bubblecloud.zigbee.api.cluster.impl.api.measurement_sensing.TemperatureMeasurement}</li>
</ul>

<p>
The following events are supported -:
<ul>
<li>{@link org.bubblecloud.zigbee.api.cluster.measurement_sensing.event.LightSensorTypeEvent} through the {@link org.bubblecloud.zigbee.api.cluster.measurement_sensing.event.LightSensorTypeListener} interface</li>
<li>{@link org.bubblecloud.zigbee.api.cluster.measurement_sensing.event.MeasuredValueEvent} through the {@link org.bubblecloud.zigbee.api.cluster.measurement_sensing.event.MeasuredValueListener} interface</li>
<li>{@link org.bubblecloud.zigbee.api.cluster.measurement_sensing.event.OccupancyEvent} through the {@link org.bubblecloud.zigbee.api.cluster.measurement_sensing.event.OccupancyListener} interface</li>
<li>{@link org.bubblecloud.zigbee.api.cluster.measurement_sensing.event.ToleranceEvent} through the {@link org.bubblecloud.zigbee.api.cluster.measurement_sensing.event.ToleranceListener} interface</li>
</ul>

<h2>References</h2>
<a href="https://docs.zigbee.org/zigbee-docs/dcn/07/docs-07-5367-02-0afg-home-automation-profile-for-public-download.pdf">Home Automation Profile Spec</a>
See table 5.1 for HA device types
</body>
